home *** CD-ROM | disk | FTP | other *** search
- Path: bunsen.HRZ.Uni-Marburg.DE!reeh
- From: reeh@bunsen.HRZ.Uni-Marburg.DE (Achim Reeh)
- Newsgroups: comp.unix.osf.osf1,comp.lang.c
- Subject: Re: printf-problem
- Followup-To: comp.unix.osf.osf1,comp.lang.c
- Date: 19 Jan 1996 17:11:31 GMT
- Organization: Department of Physics, University of Marburg, Germany
- Distribution: world
- Message-ID: <4dojc3$g2j@surz03fi.HRZ.Uni-Marburg.DE>
- References: <4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de>
- Reply-To: Achim.Reeh@mailer.uni-marburg.de
- NNTP-Posting-Host: bunsen.hrz.uni-marburg.de
- X-Newsreader: TIN [version 1.2 PL2]
-
- Henrik Wist (wist@lam.mw.tu-muenchen.de) wrote:
- : Problem:
- : long int zahl; /* which is e.g. 10000500001 */
- : printf("%d\n",zahl); /* gives 1410565409, which is definitly wrong */
-
- Solution:
- printf("%ld\n",zahl); /* gives 10000500001 */
- ^^^
- %ld is the format specifier for long int output. long ints are 64 bit
- under DEC Unix and DEC C. ints (format %d) have only 32 bit.
-
- Achim
- --
- Achim Reeh, Achim.Reeh@mailer.uni-marburg.de
-